#include "Segment3D.h"

using namespace geom;

Segment3D::Segment3D(const Point3D &from, const Point3D &to)
{
    p = from;
    v = Vector3D(to.x - from.x, to.y - from.y, to.z - from.z);
}

Segment3D::Segment3D(const Point3D &origin, const Vector3D &vec)
{
    p = origin;
    v = vec;
}

Point3D Segment3D::start() const
{
    return p;
}

Point3D Segment3D::end() const
{
    return p+v;
}

Vector3D Segment3D::direction() const
{
    return v;
}

